Skip to content

Conversation

@111Kamil111
Copy link
Owner

No description provided.

Copy link

@ArturNurtdinov ArturNurtdinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет, на будущее - на проверку необходимо присылать ссылку на PR, а не ссылку на проект, в данном случае ссылка выглядела бы так - https://github.com/111Kamil111/Java-Module-Project-YP/pull/1

Comment on lines +21 to +23
int minSpeed = 0;
int maxSpeed = 250;
if (speed > minSpeed && speed <= maxSpeed) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Минимальную и максимальную скорости лучше вынести в константы для повышения читабельности кода

Comment on lines +39 to +40
String name;
int speed;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поля лучше пометить final, тем самым исключив возможность их модификации извне

Comment on lines +50 to +51
String leader = "";
int distance = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Эти два поля лучше пометить private, чтобы инкапсулировать логику определения победителя, а для получения имени победителя - написать отдельную функцию-геттер

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants